home *** CD-ROM | disk | FTP | other *** search
/ Teach Your Children: Road Construction Ahead / Teach Your Children: Road Construction Ahead.iso / pc / rca / road.dxr / 00026_LoopButton Group Parent.ls < prev    next >
Encoding:
Text File  |  1996-07-17  |  1.3 KB  |  48 lines

  1. property firstChannel, loopButtonList, waitFlag
  2. global gLoopButton, gErrorTrapFlag
  3.  
  4. on birth me
  5.   set gLoopButton to EMPTY
  6.   set loopButtonList to []
  7.   set firstChannel to 7
  8.   set waitFlag to 0
  9.   add(loopButtonList, birth(script "Loop Button Class", 7, 7, "flagButtonHandler( gMenuObject , 1 )", "RCA-06VO03", "RCA-06RO03"))
  10.   add(loopButtonList, birth(script "Loop Button Class", 7, 8, "flagButtonHandler( gMenuObject , 2 )", "RCA-06VO04", "RCA-06RO04"))
  11.   add(loopButtonList, birth(script "Loop Button Class", 7, 9, "flagButtonHandler( gMenuObject , 3 )", "RCA-06VO05", "RCA-06RO05"))
  12.   return me
  13. end
  14.  
  15. on update me
  16.   if gErrorTrapFlag then
  17.     set gErrorTrapFlag to 0
  18.     exit
  19.   end if
  20.   if objectp(gLoopButton) then
  21.     process(gLoopButton)
  22.   else
  23.     set whichbutton to 0
  24.     repeat with rollChannel = firstChannel to firstChannel + count(loopButtonList) - 1
  25.       if rollOver(rollChannel) then
  26.         set whichbutton to rollChannel - firstChannel + 1
  27.         exit repeat
  28.       end if
  29.     end repeat
  30.     if (whichbutton > 0) and not soundBusy(1) then
  31.       hideOtherActors(me)
  32.       activate(getAt(loopButtonList, whichbutton))
  33.     else
  34.       if waitFlag then
  35.         set waitFlag to 0
  36.       else
  37.         repeat with button in loopButtonList
  38.           changeBitmap(button)
  39.         end repeat
  40.       end if
  41.     end if
  42.   end if
  43. end
  44.  
  45. on waitOneFrame me
  46.   set waitFlag to 1
  47. end
  48.